/*
 *Copyright (c) 2024 Black Sesame Technologies
 *
 *Licensed under the Apache License, Version 2.0 (the "License");
 *you may not use this file except in compliance with the License.
 *You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 *Unless required by applicable law or agreed to in writing, software
 *distributed under the License is distributed on an "AS IS" BASIS,
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *See the License for the specific language governing permissions and
 *limitations under the License.
*/
 
/*  
 *  VERSION :
 *  Autosar Version      : 4.4.0
 *  SW Version           : 1.0.0
*/
#ifndef VCAN_TYPES_H
#define VCAN_TYPES_H

/**
*   @file    VCan_Types.h
*   @version 1.0.0
*
*   @brief   AUTOSAR VCan - module interface.
*   @details API header for VCAN driver.
*
*   @addtogroup VCAN_DRIVER
*   @{
*/
#ifdef __cplusplus
extern "C"{
#endif
/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
//#include "StandardTypes.h"
#include "types.h"
/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/
#define LLCG_CONFIG_MAXCTRL_COUNT 16 //最大16路VCAN
#define LLCG_CONFIG_MAXFILTER_COUNT 64 //最大64个filter

typedef enum
{
    LLCG_ROUTETABLE_CAN_2_CAN        = (1 << 0),
    LLCG_ROUTETABLE_CAN_2_ETH        = (1 << 1),
    LLCG_ROUTETABLE_CAN_2_SWITCH_2   = (1 << 2),
    LLCG_ROUTETABLE_CAN_2_SWITCH_3   = (1 << 3),
    LLCG_ROUTETABLE_CAN_2_SWITCH_4   = (1 << 4),
    LLCG_ROUTETABLE_CAN_2_SWITCH_5   = (1 << 5),
    LLCG_ROUTETABLE_CAN_2_REALTIME_0 = (1 << 6),
    LLCG_ROUTETABLE_CAN_2_REALTIME_1 = (1 << 7),
    LLCG_ROUTETABLE_CAN_2_REALTIME_2 = (1 << 8),
    LLCG_ROUTETABLE_CAN_2_REALTIME_3 = (1 << 9),
    LLCG_ROUTETABLE_CAN_2_REALTIME_4 = (1 << 10),
    LLCG_ROUTETABLE_CAN_2_REALTIME_5 = (1 << 11),
    LLCG_ROUTETABLE_CAN_2_IVI        = (1 << 12),
    LLCG_ROUTETABLE_CAN_2_ADAS       = (1 << 13),
    LLCG_ROUTETABLE_CAN_2_DB         = (1 << 14)
}LLCG_RouteTableDestination;


typedef struct
{
    boolean bRemapCanIDEnable;
    uint32 u32RemapCanID;
    uint8 u8DestHwChList[LLCG_CONFIG_MAXCTRL_COUNT]; 
    uint8 u8DestHwChListCount;
}LLCG_Can2CanOptions;

typedef struct
{
    uint8 u8Can2EthDestMac[6];
}LLCG_Can2EthOptions;

typedef struct
{
    LLCG_RouteTableDestination Destination; //目的地，CAN2CAN，CAN2ETH, CAN2AUTOSAR, CAN2SST
    LLCG_Can2CanOptions Can2CanOptions;
    LLCG_Can2EthOptions Can2EthOptions;
}LLCG_RouteTableBaseType;

typedef struct
{
    uint32 u32CanID;
    LLCG_RouteTableBaseType * pRouteTable;
}LLCG_CommonRouteTableType;



#ifdef __cplusplus
}
#endif

#endif /* VCAN_TYPES_H */
